﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class control_SellingItemInfo : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //示例
        //this.setPicturePath("~/images/Logo.png");
        //this.Name = "可口可乐";
        //this.ReservedPrice = "999$";
        //this.MaxBidPrice = "1000$";
        //this.BidTime = "两天前";
        //this.LeftTime = "4天";
        //this.Description = "我喜欢这种味道";
    }
    //设置商品图片路径
    public void setPicturePath(String path)
    {
        imageButton.ImageUrl = path;// "~/images/Logo.png";
    }
    //商品显示的名称
    public string Name
    {
        get { return name.Text; }
        set { name.Text = value; }
    }
    //保底的价格
    public string ReservedPrice
    {
        get { return reservedPrice.Text; }
        set { reservedPrice.Text = value; }
    }
    //最高的竞标价格
    public string MaxBidPrice
    {
        get { return bidPrice.Text; }
        set { bidPrice.Text = value; }
    }
    //我上次投标的时间，可以显示具体的时刻，也可以显示距今的时间间隔
    public string BidTime
    {
        get { return bidTime.Text; }
        set { bidTime.Text = value; }
    }
    //竞拍剩余时间
    public string LeftTime
    {
        get { return leftTime.Text; }
        set { leftTime.Text = value; }
    }
    //商品描述
    public string Description
    {
        get { return note.Text; }
        set { note.Text = value; }
    }
    public string Link
    {
        set
        {
            imageButton.PostBackUrl = value;
        }
    }
    public void setPaidButtonVisable(bool visable)
    {
        paidButton.Visible = visable;
    }
    // ImageButtonClick事件处理函数类型
    public delegate void ButtonClickHandler(object sender, EventArgs e);
    // ImageButtonClick事件
    public event ButtonClickHandler imageButtonClick;
    protected void imageButton_Click(object sender, ImageClickEventArgs e)
    {
        imageButtonClick(this, e);
    }
    //付款的事件处理
    public delegate void paidButtonButtonClickHandler(object sender, EventArgs e);
    public event paidButtonButtonClickHandler paidButtonButtonClickEvent;
    protected void paidButton_Click(object sender, EventArgs e)
    {
        paidButtonButtonClickEvent(this, e);
    }
}